import { getAction, deleteAction, postAction } from '@/api/manage'
import { serviceApi } from '@/api/common.js'
/**
 * 公共API接口
 */
export const api = {
  list: (departId) => serviceApi.auth + `/departs/${departId}/users`,
  edit: (departId) => serviceApi.auth + `/departs/${departId}/users`,
  delete: (departId, userIds) => serviceApi.auth + `/departs/${departId}/users/${userIds}`
}

/**
 * 通过部门ID查询用户信息
 * @param {*} params
 * @returns
 */
export const queryUserByDepartId = (departId, params) => getAction(api.list(departId), params)

/**
 * 编辑用户部门关联
 * @param params
 * @returns {AxiosPromise}
 */
export const editUserDepart = (departId, params) => postAction(api.edit(departId), params)
